package com.zhss.springbootdemo01.validate;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.*;

/**
 * @ClassName Age
 * @Description TODO
 * @Author leejiliang
 * @DateTime 2021/2/6 22:02
 * @Version 1.0
 */
@Constraint(validatedBy = {AgeValidator.class})
@Documented
@Target({ElementType.ANNOTATION_TYPE, ElementType.METHOD, ElementType.FIELD})
@Retention(RetentionPolicy.RUNTIME)
public @interface Age {
	String message() default "年龄非法, 最大不超过{max}, 最小{min}";
	int max() default 10;
	int min() default 1;
	Class<?>[] groups() default {};
	Class<? extends Payload>[] payload() default {};
}
